﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Cofe.Core.Implements;
using Cofe.Core.Property;

namespace Cofe.Core
{
    public static class IEntryConstructorExtension
    {
        public static Task<ICofeSystemInfo> ConstructEntryAsync(this EntryConstructor entryConstructor, IPropertyProvider propProvider)           
        {
            return entryConstructor.ConstructEntryAsync(entryConstructor.ConstructPropertyHost(propProvider));
        }        

        public static ICofeSystemInfo ConstructEntry(this EntryConstructor entryConstructor, IPropertyProvider propProvider)         
        {
            return entryConstructor.ConstructEntry(entryConstructor.ConstructPropertyHost(propProvider));
        }

        public static Task<T> ConstructEntryAsync<T>(this EntryConstructor entryConstructor, IPropertyProvider propProvider)
            where T : ICofeSystemInfo
        {
            return entryConstructor.ConstructEntryAsync<T>(entryConstructor.ConstructPropertyHost(propProvider));
        }

        public static T ConstructEntry<T>(this EntryConstructor entryConstructor, IPropertyProvider propProvider)
         where T : ICofeSystemInfo
        {
            return entryConstructor.ConstructEntry<T>(entryConstructor.ConstructPropertyHost(propProvider));
        }

    }
}
